package javase.collections;

import java.util.ArrayList;
import java.util.List;

public class SubView {
	public static void main(String[] args) {
		List<Integer> list = getInitializedArrayList();
		System.out.println(list);
		List<Integer> subList = list.subList(2, 5);
		subList.remove(0);
		subList.add(123);
		System.out.println(list);
	}
	
	private static ArrayList<Integer> getInitializedArrayList() {
		ArrayList<Integer> result = new ArrayList<Integer>();
		for (int i = 0; i < 10; i++) {
			result.add(i);
		}
		return result;
	}
}
